<template>
  <el-dialog :title="title" :close-on-click-modal="false" :fullscreen="true" :visible.sync="visible"
    :before-close="cancel" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="50%">
    <el-row class="JNPF-common-search-box" :gutter="16">
      <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
        

          <el-col :span="8">
          <el-form-item label="教育局编号"" prop="FCATNO">
            <el-input v-model="dataForm.FCATNO"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
            <el-form-item label="所属地区">
              <el-select v-model="dataForm.FAREA" placeholder="请选择">
                <el-option
                  v-for="item in options4"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="教育局状态">
              <el-select v-model="dataForm.FBILLSTATE" placeholder="请选择" disabled>
                <el-option
                  v-for="item in options3"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
          <el-form-item label="教育局名称"" prop="FCATNAME">
            <el-input v-model="dataForm.FCATNAME"   />
          </el-form-item>
        </el-col>

          <el-col :span="8">
          <el-form-item label="申报人员"" prop="FUSER">
            <el-input v-model="dataForm.FUSER"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item  label="联系电话" prop="FTEL">
              <el-input v-model="dataForm.FTEL" />
          </el-form-item>
       </el-col>

        
        <el-col :span="5">
          <el-form-item label="">
            <!-- <el-button type="success" icon="el-icon-plus" @click="insert">添加场地</el-button> -->
            <el-button type="primary" :loading="loading" @click="closePage">返回</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>

    <template>
     <el-tabs v-model="activeName" type="card" @tab-click="handleClick">

      <el-tab-pane label="教育局介绍" name="second">
        
        <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
          
          <el-input
                type="textarea"
                :rows="3"
                placeholder="请输入内容"
                v-model="textarea">
              </el-input>

         </el-form>

      </el-tab-pane>

      <el-tab-pane label="联系人员" name="four">
        <el-table :data="list3" border stripe>
          <!-- <el-table-column label="操作" width="80">
            <template slot-scope="scope">
              <el-button slot="reference" icon="el-icon-delete" style="color: red" @click="shopdate(scope.$index)"
                type="text">删除</el-button>
            </template>
          </el-table-column> -->
          <el-table-column prop="FENTRYID"FDATE label="序号" width="85" ></el-table-column>
          <el-table-column prop="FPOINT" label="职务" width="95" ></el-table-column>
          <el-table-column prop="FWORK" label="职责"   ></el-table-column>
          <el-table-column prop="FCATNAME" label="姓名"  width="105" ></el-table-column>
          <el-table-column prop="FTEL" label="电话号码"   ></el-table-column>
          <el-table-column prop="FEMAIL" label="电子邮箱"   ></el-table-column>
          <el-table-column prop="FMEMO" label="备注"></el-table-column>
        </el-table>
        <!-- <div class="addbox">
             <el-link icon="el-icon-plus" type="primary" >添加一行</el-link>
        </div> -->
      </el-tab-pane>

    </el-tabs>
    
   </template>

    <StudqueryFcuston ref="StudqueryFcuston" @confirm="shoplist" />
  </el-dialog>
</template>
<script>
  import StudqueryFcuston from "@/components/StudqueryFcuston/StudqueryFcuston.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    components: { StudqueryFcuston },
    props: {
      formationlist: {
        type: Array,
        default: [],
      },
    },
    data() {
      return {
        activeName: 'second',

        title: "新增",
        insertorupdate: true,
        dataForm: {
            FBILLNO: "Y241130002", 
            FBILLCREDATE:"2024-12-13",
            FUSER: "王副校长",
            FSCHOOL: "闵行莘城中学",
            FCATNO:"ZF103",
            FCATNAME: "宝山教育局",
            FPOINT:"上海国际汽车城",
            FTYPE:"国资委",
            FAREA:"嘉定区",
            FBEGDATE: "2025-03-15",
            FENDDATE:"2025-03-17",
            FTEL:"021-59829876",
            FNUM:250,
            FMONEY:500,
            FMEMO: "3天2夜汽车之友",
            FCHECKUSE: "",
            FCHECKDATE: "",
            FACCNO:"908374659868769",
            FBILLTYPE:"改机构",
            FBILLSTATE: "正常"
        },
        rules: {
          FUSERNUMBER:[
            { required: true, message: '请输入学籍号码', trigger: 'blur' },
          ],
          FUSER: [
            { required: true, message: '请输入申请人员', trigger: 'blur' },
          ],
          FMEMO: [
            { required: true, message: '请输入申请理由', trigger: 'blur' },
          ],
        },
        list1: [{ "FENTRYID":1,
                  "FTYPE": "旅游社经营许可证",
                  "FDATE":"2028-12-31",
                  "FMEMO": ""
                },
                { "FENTRYID":2,
                  "FTYPE": "企业营业执照",
                  "FDATE":"2045-02-09",
                  "FMEMO": ""
                }],
        list2: [{  "FENTRYID":1,
                    "FTYPE": "机构类型",
                    "FCATNAME": "科研探索",
                    "FMEMO": ""
                  },
                  { "FENTRYID":2,
                    "FTYPE": "机构等级",
                    "FCATNAME": "省级",
                    "FMEMO": ""
                  },
                  { "FENTRYID":3,
                    "FTYPE": "机构规模",
                    "FCATNAME": "中型",
                    "FMEMO": ""
                  }],

        list3: [{  "FENTRYID":1,
                    "FPOINT": "局长",
                    "FWORK":"主持市教育局党委、行政全面工作",
                    "FCATNAME": "张飞",
                    "FTEL":"135****9087",
                    "FEMAIL":"135****9087@qq.com",
                    "FMEMO": ""
                  },
                  { "FENTRYID":2,
                    "FPOINT": "副局长‌",
                    "FWORK":"分管体育卫生与艺术教育处",
                    "FCATNAME": "大乔",
                    "FTEL":"180****9087",
                    "FEMAIL":"180****9087@qq.com",
                    "FMEMO": ""
                  },
                  { "FENTRYID":3,
                    "FPOINT": "副局长‌",
                    "FWORK":"分管办公室",
                    "FCATNAME": "小乔",
                    "FTEL":"166****9087",
                    "FEMAIL":"166****9087@qq.com",
                    "FMEMO": ""
                  }],
        
        loading: false,
        visible: false,

        //所属校区选择数据
        options1: [{
          value: '1',
          label: '新机构'
        }, {
          value: '2',
          label: '改机构'
        }, {
          value: '3',
          label: '老机构'
        }],

        //所属校区选择数据
        options2: [{
          value: '1',
          label: '国资委'
        }, {
          value: '2',
          label: '民营'
        }, {
          value: '3',
          label: '合资'
        }],

        options3: [{
          value: '1',
          label: '申报中'
        }, {
          value: '2',
          label: '已审批'
        }, {
          value: '3',
          label: '已驳回'
        }],

        options4: [{
          value: '1',
          label: '上海市'
        }, {
          value: '2',
          label: '黄浦区'
        }, {
          value: '3',
          label: '嘉定区'
        }],
        
      };
    },
    created() {
    },
    mounted() { },
    methods: {
      closePage(){
        console.log('关闭弹窗dialog');
        this.visible = false;
      },
      init(FBILLNO) {
        this.dataForm.FBILLNO = FBILLNO;
        if (this.dataForm.FBILLNO) {
          this.title = "修改"
          this.insertorupdate = false;
        }
        else {
          this.title = "新增"
          this.dataForm.FBILLNO = "K" + Math.floor(Math.random() * 10000000) + 1;
          this.insertorupdate = true;
        }
        this.visible = true;
      },
      insert() {
        this.$refs.StudqueryFcuston.open();
      },
      shopdate(id) {
        let link = document.createElement('a');
        link.href = 'http://180.166.193.6:90/images/study/acc-01.png';
        link.target = '_blank'; // 在新窗口或新标签页中打开URL
        link.click();
      },
      //
      cancel() {
        this.$refs.elForm.resetFields();
        this.list = [];
        this.visible = false;
      },
    },
  };
</script>